package com.zq.disruptor;

import com.lmax.disruptor.RingBuffer;

import java.nio.ByteBuffer;

public class Producer {
    private final RingBuffer<PCData> ringBuffer;
    public  Producer(RingBuffer<PCData> ringBuffer){
        this.ringBuffer=ringBuffer;
    }
    public void pushData(long value){
        long sequence = ringBuffer.next();
        PCData pcData = ringBuffer.get(sequence);
        pcData.setValue(value);
        ringBuffer.publish(sequence);
    }
}
